/**
 * User: c3t
 * Date: 13-11-14
 * Time: 下午2:30
 */
define(function(require, exports, module) {


    var obj = require('lib/XmlHttpRequest');

    window.onload = init;
    function init() {
        var btn = document.getElementById("getData");
        btn.onclick = getData;
    }

    function getData() {


        var xhr = obj.getXHR();
        xhr.open("GET", "/ajax/ajax.do", true);
        xhr.onreadystatechange = function () {
            if ((xhr.readyState == 4) && (xhr.status == 200)) {
                document.getElementById("serverData").innerHTML = xhr.responseText;
            }
        }
        xhr.send();
    }
});